<?php
/***
	update view count
***/
header('Access-Control-Allow-Origin: *');
header('Access-Control-Allow-Methods: POST, GET, OPTIONS');
header('Access-Control-Max-Age: 1000');
require "../config.php";
require "../libs/db_functions.php";

  $story_id =  isset($_REQUEST['story_id'])? $_REQUEST['story_id'] : 1;
	CONNECT_DB();
		$sql=	"UPDATE story_list SET  story_view = story_view + 1 
				WHERE story_id = $story_id";
		$result=mysql_query($sql);
		
		if ($result){
			echo 'successful';
		} else {
			echo 'err!';
		}
	CLOSE_DB();
?> 